﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Taoyl.CodeTraceDAL;
using Taoyl.CodeTraceModels;
using xbd.DataConvertLib;

namespace Taoyl.CodeTraceBLL
{
    public class HourProductionManager
    {
        private HourProductionService productionService=new HourProductionService();

        public OperateResult UpdateHourProduction(bool result)
        {
            try
            {
               var res= productionService.UpdateHourProduction(result);
                return res==1?OperateResult.CreateSuccessResult():OperateResult.CreateFailResult("受影响行数不为1"+res);
            }
            catch (Exception ex)
            {
                return OperateResult.CreateFailResult(ex.Message);
            }
        }

        public OperateResult<List<ProductionData>, DayProduction> GetDayStatics(int month, int day)
        {
            return productionService.GetDayStatics(month, day);
        }

        public OperateResult<List<ProductionData>, MonthProduction> GetMonthStatics(int month)
        {
            return productionService.GetMonthStatics(month);
        }
    }
}
